﻿#include "player.h"
#include <QDebug>
Player::Player(QObject *parent) : QObject(parent)
{
    m_pendPlayer=nullptr;
}

Player::Player(QString name, QObject *parent)
{
    qRegisterMetaType<Cards>("Cards");
    m_pendPlayer=nullptr;
    m_name=name;
}

void Player::setName(QString name)
{
    m_name=name;
    
}

QString Player::getName()
{
    return m_name;
}

void Player::setRole(Player::Role role)
{
    m_role=role;
}

Player::Role Player::getRole()
{
    return m_role;
}

void Player::setSex(Player::Sex sex)
{
    m_sex=sex;
}

Player::Sex Player::getSex()
{
    return m_sex;
}

void Player::setDirection(Player::Direction dir)
{
    m_dir=dir;
}

Player::Direction Player::getDirection()
{
    return m_dir;
}

void Player::setType(Player::Type type)
{
    m_type=type;
}

Player::Type Player::getType()
{
    return m_type;
}

void Player::setScore(int score)
{
    m_score=score;
}

int Player::getScore()
{
    return m_score;
}

void Player::setWin(bool flag)
{
    m_iswin=flag;
}

bool Player::getWin()
{
    return m_iswin;
}

void Player::setPrevPlayer(Player *player)
{
    m_prevPlayer=player;
}

void Player::setNextPlayer(Player *player)
{
    m_nextPlayer=player;
}

Player *Player::getPrevPlayer()
{
    return m_prevPlayer;
}

Player *Player::getNextPlayer()
{
    return m_nextPlayer;
}

void Player::grabLordBet(int point)
{
    emit notifyGrabLordBet(this,point);
}

void Player::storeDispatchCard(Cards &cards)
{
    m_cards.add(cards);
    emit notifyPickCards(this,cards);
}

void Player::storeDispatchCard(Card &card)
{
    m_cards.add(card);
    Cards cards(card);
    emit notifyPickCards(this,cards);

}

Cards Player::getCards()
{
    return m_cards;
}

void Player::clearCards()
{
    m_cards.clear();
}

void Player::playHand(Cards &cards)
{
    m_cards.remove(cards);
    emit notifyPlayhand(this,cards);

}

void Player::setPendingInfo(Player *player, Cards &cards)
{
    m_pendPlayer=player;
    m_pendCards=cards;
}

Player *Player::getPendPlayer()
{
    return m_pendPlayer;
}

Cards Player::getPendCards()
{
    return m_pendCards;
}

void Player::storePendingInfo(Player *player, Cards &cards)
{
    m_pendPlayer=player;
    m_pendCards =cards;
}

void Player::prepareCallLord()
{

}

void Player::preparePlayHand()
{

}

void Player::thinkCallLord()
{

}

void Player::thinkPlayhand()
{

}
